﻿@model IEnumerable<RedSand.Site.Models.RequestInfoFull>
@if (Model != null)
{
    <div id="panel-list-content-item-need">
        <div id="list-content-item-ineed">
            @foreach (var item in Model)
            {
                <div id="content-item-ineed-@item.StartId" class="panel-content-item-ineed">
                    <div class="head-content-item-ineed clearfix">
                        <img src="@item.Avatar.GetImageUrl(1)" class="avt fl" />
                        <div class="title">
                            @item.Title</div>
                        <span class="poster">@Html.Translate("UserName", "News") : @item.UserName</span>
                        <span class="post-date">@item.CreateDate.GetDate()</span> <span class="post-status">@Html.Translate("Status")
                            : @RedSand.Site.DropDownListHelper.GetStatusRequestString(@item.Status) </span>
                    </div>
                    <div class="main-content-item-ineed">
                        @item.Content
                    </div>
                    <div class="list-reply-item-ineed">
                        @Html.Action("ListReply", "Reply", new { RequestId = item.RequestID })
                        @if (User.Identity.IsAuthenticated)
                        {
                            if (item.UserName == User.Identity.Name)
                            {
                               
                            <div class="panel-reply-item-ineed clearfix">
                                <input class="RequestID" type="hidden" value="@item.RequestID" />
                                <input type="text" name="Content" maxlength="120" class="txt_comment" />
                                <input type="submit" value="@Html.Translate("Request")" class="submit_comment" />
                            </div>
                            }
                        }
                    </div>
                </div>
            }
        </div>
        <a href="#" id="close-content-item-ineed">@Html.Translate("Close")</a>
    </div>
    <div id="panel-list-item-need">
        @foreach (var item in Model)
        {
            <a href="@item.RequestID" class="item-ineed clearfix" title="content-item-ineed-@item.StartId">
                <img class="avt" alt="@item.Title" src="@item.Avatar.GetImageUrl(1)" />
                <h5>
                    @item.Title
                </h5>
                <p class="description">
                    @item.Content.SubStringExtended(0, 140)
                    <br />
                    <span class="poster">@Html.Translate("UserName", "News") : @item.UserName</span>
                    <span class="post-date">@item.CreateDate.GetDate()</span><span class="post-status">
                        @Html.Translate("Status") : @RedSand.Site.DropDownListHelper.GetStatusRequestString(@item.Status)</span>
                </p>
            </a>
        }
    </div>
    <div id="footer-ineed">
        <img src="/Content/Frontend/rs-v10/images/ajax-loader.gif" style="margin-top: -3px;
            margin-right: 10px;" width="50px" class="imgLoading" />
        <a href="#" id="prev-ineed">« @Html.Translate("Previous")</a>
        @Ajax.ActionLink(Html.Translate("Next") + " »", "GetListRequest", "Request", new { StartId = Model.LastOrDefault().StartId }, new AjaxOptions { UpdateTargetId = "TagUpdateIneed", InsertionMode = InsertionMode.Replace, OnComplete = "ObjectIneed.OnSuccess", OnBegin = "ObjectIneed.OnBeign" }, new { id = "next-ineed" })
    </div>
    <div id="TagUpdateIneed" style="display: none">
    </div>
}
